<?php

// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');

// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
	'name'=>'小熊应用中心8.24',
	
		
		//路径别名
		// 可以是应用内部的路径，也可以是外部资源
		'aliases'=>array(
				'myExternalFramework'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'myexternalframework'
		),
	//'catchAllRequest'=>array('site/all'), //维护状态 所有请求都转发到这里
	
		//如何在应用程序处理请求之前执行一段操作？当然这个function方法要存在index.php
	//'onBeginRequest' => 'function',
		
		
		
	// preloading 'log' component
	'preload'=>array('log'),

	// autoloading model and component classes  // 自动载入的类  
	'import'=>array(
		'application.models.*',
		'application.components.*',
		'application.extensions.oauth.*',
		'application.extensions.pic.*',
	),

	'modules'=>array(
		// uncomment the following to enable the Gii tool
		
		'gii'=>array(
			'class'=>'system.gii.GiiModule',
			'password'=>'password',
		 	// If removed, Gii defaults to localhost only. Edit carefully to taste.
			//ipFilters用于所在服务器不在本机的情况需开启
			//'ipFilters'=>array('192.168.1.10','::1'),
			'ipFilters'=>array('127.0.0.1','::1'), //gii 访问限制IP 
		),
		'Admin'=>array(
			'class'=>	'application.modules.Admin.AdminModule',	//后台地址
		),
		
	),
	
	'defaultController'=>'TqqUser',  //默认访问页面
	
	'language'=>'es',  //默认语言
	
	//信息和视图的语言
	'sourceLanguage'=>'es',
	'timeZone'=>'Asia/Shanghai',
	'theme'=>'school',
	// 使用的字符集
	'charset'=>'utf-8',
	
	
	// 应用组件的配置
	// application components
	'components'=>array(
	
		'assetManager'=>array(
				// 改变磁盘上的路径
				'basePath'=>dirname(__FILE__).'/../../assets/',
				// 改变url
				'baseUrl'=>'/web/assets/'
		),
		'user'=>array(
			// enable cookie-based authentication
			'allowAutoLogin'=>true,
		),
		
		'session'=>array(
				'autoStart'=>true,
				//'sessionName'=>'Site Access',
				//'cookieMode'=>'only',
				//'savePath'=>'/system/to/new/directory',
		),
		
		//YII AssetManager分析 最小化脚本文件
		/*
		 * 
		 * 'clientScript'=>array(
				'coreScriptUrl'=>'/js', // required to prevent asset publishing of core scripts
				'scriptMap'=>array(
						'*.js'=>false,
						'*.css'=>false,
				),
		),
		
		*/
		
		
		/*  自定义类  把CsvController.php放到protected/extensions/csv目录  集成 CController

			'controllerMap'=>array(
					'csv'=>array(
							'class'=>'application.extensions.csv.CsvController'
					),
			),
		
	*/
		
		// uncomment the following to enable URLs in path-format
		// 这里是用来美化url，帮助SEO
		//'urlManager'=>array(
		//	'urlFormat'=>'path',
		//	'rules'=>array(
				//'<controller:\w+>/<id:\d+>'=>'<controller>/view',
				//'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
				//'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
				//'home' => 'website/index',
				//'page/about/<alias:authors>' => 'website/page',
				//'<alias:about>' => 'website/page',
				//'page/<alias>' => 'website/page',
		//	),
	//	),
		
		
		
		/*
		'db'=>array(
			'connectionString' => 'sqlite:'.dirname(__FILE__).'/../data/testdrive.db',
		),
		*/	
		// uncomment the following to use a MySQL database
		
		'db'=>array(
			'connectionString' => 'mysql:host=upour.gotoftp3.com;dbname=upour',
			'emulatePrepare' => true,
			'username' => 'upour',
			'password' => 'zxcvbnm123',
			'charset' => 'utf8',
			'tablePrefix' => 'app_',
		),
		
		'errorHandler'=>array(
			// use 'site/error' action to display errors
            'errorAction'=>'site/error',
        ),
		'log'=>array(
			'class'=>'CLogRouter',
			'routes'=>array(
				array(
					'class'=>'CFileLogRoute',
					'levels'=>'error, warning',
				),
				// uncomment the following to show log messages on web pages
				
				array(
					'class'=>'CWebLogRoute',
					'levels'=>'trace',  //级别为trace  
					'categories'=>'system.db.*', //仅仅显示数据库的log  
				),
				
			),
		),
	),

	// application-level parameters that can be accessed
	// using Yii::app()->params['paramName']
	
	
	'params'=>require(dirname(__FILE__).'/params.php'),



	
	
);